package eerbaar.server.serializer.internal;

import javax.xml.stream.XMLStreamException;

import eerbaar.shared.exceptions.GameException;
import eerbaar.shared.tree.INode;
import eerbaar.shared.tree.INodeXMLConverter;


public class ServerConverter implements INodeXMLConverter {

    @Override
    public INode convertToNode(String inData) throws GameException {
        assert (inData != null);

        try {
            return new ConvertToNode().convert(inData);
        } catch (XMLStreamException e) {
            e.printStackTrace();
            throw new GameException(e);
        }
    }

    @Override
    public String convertToXml(INode inNode) throws GameException {
        assert (inNode != null);

        return new ConvertToXml().convert(inNode);
    }

}
